<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>性别统计</title>
    <script type="text/javascript" src="/js/echarts.min.js"></script>
    <script type="text/javascript" src="/js/jquery-3.5.1.min.js"></script>
</head>
<body>
    <div id="main" style="width: 700px;height:600px;">

    </div>

</body>

<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('main'));

    $.get("/reg/ageStat" , function (backdata) {


        myChart.setOption({
            title: {
                text: '年龄分布图',
                left: 'center'
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            legend: {
                bottom: 10,
                left: 'center',
            },
            series: [
                {
                    type: 'pie',
                    radius: '65%',
                    center: ['40%', '50%'],
                    selectedMode: 'single',
                    data: backdata.data,
                }
            ]
        })

    });


</script>
</html>